<%--
  Created by IntelliJ IDEA.
  User: Shinelon
  Date: 2021/2/10
  Time: 16:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
  <script type="text/javascript">
    $(function() {
      var a=0;
      $('#dzb').on('click', function () {
        var add=$(this).val();
        $.ajax({
          url:"/dianzan",
          data: "add="+add,
          type: "POST",
          dataType:"text",
          success: function (data) {
            $('#dznum').text(data);
          },
        });
        if (add=="加"){
          $(this).val("减");
        }else{
          $(this).val("加");

        }
      });
    })
    /**/
  </script>
  <body>
    <button id="dzb" value="加" name="add">点赞</button>
    点赞数:<span id="dznum">0</span>
  </body>

</html>
